﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _003_委托
{
    
    class Program
    {
        //定义委托
        private delegate string GetAString();
        static void Main(string[] args)
        {
//            int x = 40;
//            GetAString myfun = new GetAString(x.ToString);
//            Console.WriteLine(myfun());
//            Console.ReadKey();

            PrintString method;
            method = () => Console.WriteLine("666666");
            method += () => Console.WriteLine("委托的多播");
            PrintStr(method);
            Console.ReadKey();
        }

        private delegate void PrintString();

        static void PrintStr(PrintString print)
        {
            print.Invoke();
        }

    }
}
